package com.manzuo.framework.datasource;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

import com.manzuo.framework.log.AutoLog;

/**
 * 根据{@link ReadWriteContext}自动进行切换的读写分离数据源。
 * @see AbstractRoutingDataSource
 * @author 高恒
 */
public class ReadWriteDataSource extends AbstractRoutingDataSource {

	@Override
	@AutoLog("确定选择读写数据源key值")
	protected Object determineCurrentLookupKey() {
		return ReadWriteContext.getFlag().name();
	}

}
